<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Installation Procedure</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REV="MADE"
HREF="mailto:pgsql-docs@postgresql.org"><LINK
REL="HOME"
TITLE="PostgreSQL 9.1.2 Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="  Installation from Source Code"
HREF="installation.html"><LINK
REL="PREVIOUS"
TITLE="Getting The Source"
HREF="install-getsource.html"><LINK
REL="NEXT"
TITLE="Post-Installation Setup"
HREF="install-post.html"><LINK
REL="STYLESHEET"
TYPE="text/css"
HREF="stylesheet.css"><META
HTTP-EQUIV="Content-Type"
CONTENT="text/html; charset=ISO-8859-1"><META
NAME="creation"
CONTENT="2011-12-01T22:07:59"></HEAD
><BODY
CLASS="SECT1"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="5"
ALIGN="center"
VALIGN="bottom"
><A
HREF="index.html"
>PostgreSQL 9.1.2 Documentation</A
></TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
TITLE="Getting The Source"
HREF="install-getsource.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
HREF="installation.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="60%"
ALIGN="center"
VALIGN="bottom"
>Chapter 15. Installation from Source Code</TD
><TD
WIDTH="20%"
ALIGN="right"
VALIGN="top"
><A
TITLE="Post-Installation Setup"
HREF="install-post.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="INSTALL-PROCEDURE"
>15.4. Installation Procedure</A
></H1
><DIV
CLASS="PROCEDURE"
><OL
TYPE="1"
><LI
CLASS="STEP"
><A
NAME="CONFIGURE"
></A
><P
><B
>Configuration</B
></P
><P
>    The first step of the installation procedure is to configure the
    source tree for your system and choose the options you would like.
    This is done by running the <TT
CLASS="FILENAME"
>configure</TT
> script. For a
    default installation simply enter:
</P><PRE
CLASS="SCREEN"
><KBD
CLASS="USERINPUT"
>./configure</KBD
></PRE
><P>
    This script will run a number of tests to determine values for various
    system dependent variables and detect any quirks of your
    operating system, and finally will create several files in the
    build tree to record what it found.  You can also run
    <TT
CLASS="FILENAME"
>configure</TT
> in a directory outside the source
    tree, if you want to keep the build directory separate.  This
    procedure is also called a
    <I
CLASS="FIRSTTERM"
>VPATH</I
>
    build.  Here's how:
</P><PRE
CLASS="SCREEN"
><KBD
CLASS="USERINPUT"
>mkdir build_dir</KBD
>
<KBD
CLASS="USERINPUT"
>cd build_dir</KBD
>
<KBD
CLASS="USERINPUT"
>/path/to/source/tree/configure [options go here]</KBD
>
<KBD
CLASS="USERINPUT"
>gmake</KBD
></PRE
><P>
   </P
><P
>    The default configuration will build the server and utilities, as
    well as all client applications and interfaces that require only a
    C compiler. All files will be installed under
    <TT
CLASS="FILENAME"
>/usr/local/pgsql</TT
> by default.
   </P
><P
>    You can customize the build and installation process by supplying one
    or more of the following command line options to
    <TT
CLASS="FILENAME"
>configure</TT
>:

     <P
></P
></P><DIV
CLASS="VARIABLELIST"
><DL
><DT
><TT
CLASS="OPTION"
>--prefix=<TT
CLASS="REPLACEABLE"
><I
>PREFIX</I
></TT
></TT
></DT
><DD
><P
>         Install all files under the directory <TT
CLASS="REPLACEABLE"
><I
>PREFIX</I
></TT
>
         instead of <TT
CLASS="FILENAME"
>/usr/local/pgsql</TT
>. The actual
         files will be installed into various subdirectories; no files
         will ever be installed directly into the
         <TT
CLASS="REPLACEABLE"
><I
>PREFIX</I
></TT
> directory.
        </P
><P
>         If you have special needs, you can also customize the
         individual subdirectories with the following options. However,
         if you leave these with their defaults, the installation will be
         relocatable, meaning you can move the directory after
         installation. (The <TT
CLASS="LITERAL"
>man</TT
> and <TT
CLASS="LITERAL"
>doc</TT
>
         locations are not affected by this.)
        </P
><P
>         For relocatable installs, you might want to use
         <TT
CLASS="FILENAME"
>configure</TT
>'s <TT
CLASS="LITERAL"
>--disable-rpath</TT
>
         option.  Also, you will need to tell the operating system how
         to find the shared libraries.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--exec-prefix=<TT
CLASS="REPLACEABLE"
><I
>EXEC-PREFIX</I
></TT
></TT
></DT
><DD
><P
>         You can install architecture-dependent files under a
         different prefix, <TT
CLASS="REPLACEABLE"
><I
>EXEC-PREFIX</I
></TT
>, than what
         <TT
CLASS="REPLACEABLE"
><I
>PREFIX</I
></TT
> was set to. This can be useful to
         share architecture-independent files between hosts. If you
         omit this, then <TT
CLASS="REPLACEABLE"
><I
>EXEC-PREFIX</I
></TT
> is set equal to
         <TT
CLASS="REPLACEABLE"
><I
>PREFIX</I
></TT
> and both architecture-dependent and
         independent files will be installed under the same tree,
         which is probably what you want.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--bindir=<TT
CLASS="REPLACEABLE"
><I
>DIRECTORY</I
></TT
></TT
></DT
><DD
><P
>         Specifies the directory for executable programs. The default
         is <TT
CLASS="FILENAME"
><TT
CLASS="REPLACEABLE"
><I
>EXEC-PREFIX</I
></TT
>/bin</TT
>, which
         normally means <TT
CLASS="FILENAME"
>/usr/local/pgsql/bin</TT
>.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--sysconfdir=<TT
CLASS="REPLACEABLE"
><I
>DIRECTORY</I
></TT
></TT
></DT
><DD
><P
>         Sets the directory for various configuration files,
         <TT
CLASS="FILENAME"
><TT
CLASS="REPLACEABLE"
><I
>PREFIX</I
></TT
>/etc</TT
> by default.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--libdir=<TT
CLASS="REPLACEABLE"
><I
>DIRECTORY</I
></TT
></TT
></DT
><DD
><P
>         Sets the location to install libraries and dynamically loadable
         modules. The default is
         <TT
CLASS="FILENAME"
><TT
CLASS="REPLACEABLE"
><I
>EXEC-PREFIX</I
></TT
>/lib</TT
>.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--includedir=<TT
CLASS="REPLACEABLE"
><I
>DIRECTORY</I
></TT
></TT
></DT
><DD
><P
>         Sets the directory for installing C and C++ header files. The
         default is <TT
CLASS="FILENAME"
><TT
CLASS="REPLACEABLE"
><I
>PREFIX</I
></TT
>/include</TT
>.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--datarootdir=<TT
CLASS="REPLACEABLE"
><I
>DIRECTORY</I
></TT
></TT
></DT
><DD
><P
>         Sets the root directory for various types of read-only data
         files.  This only sets the default for some of the following
         options.  The default is
         <TT
CLASS="FILENAME"
><TT
CLASS="REPLACEABLE"
><I
>PREFIX</I
></TT
>/share</TT
>.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--datadir=<TT
CLASS="REPLACEABLE"
><I
>DIRECTORY</I
></TT
></TT
></DT
><DD
><P
>         Sets the directory for read-only data files used by the
         installed programs. The default is
         <TT
CLASS="FILENAME"
><TT
CLASS="REPLACEABLE"
><I
>DATAROOTDIR</I
></TT
></TT
>. Note that this has
         nothing to do with where your database files will be placed.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--localedir=<TT
CLASS="REPLACEABLE"
><I
>DIRECTORY</I
></TT
></TT
></DT
><DD
><P
>         Sets the directory for installing locale data, in particular
         message translation catalog files.  The default is
         <TT
CLASS="FILENAME"
><TT
CLASS="REPLACEABLE"
><I
>DATAROOTDIR</I
></TT
>/locale</TT
>.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--mandir=<TT
CLASS="REPLACEABLE"
><I
>DIRECTORY</I
></TT
></TT
></DT
><DD
><P
>         The man pages that come with <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> will be installed under
         this directory, in their respective
         <TT
CLASS="FILENAME"
>man<TT
CLASS="REPLACEABLE"
><I
>x</I
></TT
></TT
> subdirectories.
         The default is <TT
CLASS="FILENAME"
><TT
CLASS="REPLACEABLE"
><I
>DATAROOTDIR</I
></TT
>/man</TT
>.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--docdir=<TT
CLASS="REPLACEABLE"
><I
>DIRECTORY</I
></TT
></TT
></DT
><DD
><P
>         Sets the root directory for installing documentation files,
         except <SPAN
CLASS="QUOTE"
>"man"</SPAN
> pages.  This only sets the default for
         the following options.  The default value for this option is
         <TT
CLASS="FILENAME"
><TT
CLASS="REPLACEABLE"
><I
>DATAROOTDIR</I
></TT
>/doc/postgresql</TT
>.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--htmldir=<TT
CLASS="REPLACEABLE"
><I
>DIRECTORY</I
></TT
></TT
></DT
><DD
><P
>         The HTML-formatted documentation for
         <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> will be installed under
         this directory.  The default is
         <TT
CLASS="FILENAME"
><TT
CLASS="REPLACEABLE"
><I
>DATAROOTDIR</I
></TT
></TT
>.
        </P
></DD
></DL
></DIV
><P>

     </P><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>       Care has been taken to make it possible to install
       <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> into shared installation locations
       (such as <TT
CLASS="FILENAME"
>/usr/local/include</TT
>) without
       interfering with the namespace of the rest of the system. First,
       the string <SPAN
CLASS="QUOTE"
>"<TT
CLASS="LITERAL"
>/postgresql</TT
>"</SPAN
> is
       automatically appended to <TT
CLASS="VARNAME"
>datadir</TT
>,
       <TT
CLASS="VARNAME"
>sysconfdir</TT
>, and <TT
CLASS="VARNAME"
>docdir</TT
>,
       unless the fully expanded directory name already contains the
       string <SPAN
CLASS="QUOTE"
>"<TT
CLASS="LITERAL"
>postgres</TT
>"</SPAN
> or
       <SPAN
CLASS="QUOTE"
>"<TT
CLASS="LITERAL"
>pgsql</TT
>"</SPAN
>. For example, if you choose
       <TT
CLASS="FILENAME"
>/usr/local</TT
> as prefix, the documentation will
       be installed in <TT
CLASS="FILENAME"
>/usr/local/doc/postgresql</TT
>,
       but if the prefix is <TT
CLASS="FILENAME"
>/opt/postgres</TT
>, then it
       will be in <TT
CLASS="FILENAME"
>/opt/postgres/doc</TT
>. The public C
       header files of the client interfaces are installed into
       <TT
CLASS="VARNAME"
>includedir</TT
> and are namespace-clean. The
       internal header files and the server header files are installed
       into private directories under <TT
CLASS="VARNAME"
>includedir</TT
>. See
       the documentation of each interface for information about how to
       access its header files. Finally, a private subdirectory will
       also be created, if appropriate, under <TT
CLASS="VARNAME"
>libdir</TT
>
       for dynamically loadable modules.
      </P
></BLOCKQUOTE
></DIV
><P>
    </P
><P
>     <P
></P
></P><DIV
CLASS="VARIABLELIST"
><DL
><DT
><TT
CLASS="OPTION"
>--with-includes=<TT
CLASS="REPLACEABLE"
><I
>DIRECTORIES</I
></TT
></TT
></DT
><DD
><P
>         <TT
CLASS="REPLACEABLE"
><I
>DIRECTORIES</I
></TT
> is a colon-separated list of
         directories that will be added to the list the compiler
         searches for header files. If you have optional packages
         (such as GNU <SPAN
CLASS="APPLICATION"
>Readline</SPAN
>) installed in a non-standard
         location,
         you have to use this option and probably also the corresponding
         <TT
CLASS="OPTION"
>--with-libraries</TT
> option.
        </P
><P
>         Example: <TT
CLASS="LITERAL"
>--with-includes=/opt/gnu/include:/usr/sup/include</TT
>.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-libraries=<TT
CLASS="REPLACEABLE"
><I
>DIRECTORIES</I
></TT
></TT
></DT
><DD
><P
>         <TT
CLASS="REPLACEABLE"
><I
>DIRECTORIES</I
></TT
> is a colon-separated list of
         directories to search for libraries. You will probably have
         to use this option (and the corresponding
         <TT
CLASS="OPTION"
>--with-includes</TT
> option) if you have packages
         installed in non-standard locations.
        </P
><P
>         Example: <TT
CLASS="LITERAL"
>--with-libraries=/opt/gnu/lib:/usr/sup/lib</TT
>.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--enable-nls[<SPAN
CLASS="OPTIONAL"
>=<TT
CLASS="REPLACEABLE"
><I
>LANGUAGES</I
></TT
></SPAN
>]</TT
></DT
><DD
><P
>         Enables Native Language Support (<ACRONYM
CLASS="ACRONYM"
>NLS</ACRONYM
>),
         that is, the ability to display a program's messages in a
         language other than English.
         <TT
CLASS="REPLACEABLE"
><I
>LANGUAGES</I
></TT
> is an optional space-separated
         list of codes of the languages that you want supported, for
         example <TT
CLASS="LITERAL"
>--enable-nls='de fr'</TT
>.  (The intersection
         between your list and the set of actually provided
         translations will be computed automatically.)  If you do not
         specify a list, then all available translations are
         installed.
        </P
><P
>         To use this option, you will need an implementation of the
         <SPAN
CLASS="APPLICATION"
>Gettext</SPAN
> API; see above.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-pgport=<TT
CLASS="REPLACEABLE"
><I
>NUMBER</I
></TT
></TT
></DT
><DD
><P
>         Set <TT
CLASS="REPLACEABLE"
><I
>NUMBER</I
></TT
> as the default port number for
         server and clients. The default is 5432. The port can always
         be changed later on, but if you specify it here then both
         server and clients will have the same default compiled in,
         which can be very convenient.  Usually the only good reason
         to select a non-default value is if you intend to run multiple
         <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> servers on the same machine.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-perl</TT
></DT
><DD
><P
>         Build the <SPAN
CLASS="APPLICATION"
>PL/Perl</SPAN
> server-side language.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-python</TT
></DT
><DD
><P
>         Build the <SPAN
CLASS="APPLICATION"
>PL/Python</SPAN
> server-side language.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-tcl</TT
></DT
><DD
><P
>         Build the <SPAN
CLASS="APPLICATION"
>PL/Tcl</SPAN
> server-side language.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-tclconfig=<TT
CLASS="REPLACEABLE"
><I
>DIRECTORY</I
></TT
></TT
></DT
><DD
><P
>         Tcl installs the file <TT
CLASS="FILENAME"
>tclConfig.sh</TT
>, which
         contains configuration information needed to build modules
         interfacing to Tcl. This file is normally found automatically
         at a well-known location, but if you want to use a different
         version of Tcl you can specify the directory in which to look
         for it.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-gssapi</TT
></DT
><DD
><P
>         Build with support for GSSAPI authentication. On many
         systems, the GSSAPI (usually a part of the Kerberos installation)
         system is not installed in a location
         that is searched by default (e.g., <TT
CLASS="FILENAME"
>/usr/include</TT
>,
         <TT
CLASS="FILENAME"
>/usr/lib</TT
>), so you must use the options
         <TT
CLASS="OPTION"
>--with-includes</TT
> and <TT
CLASS="OPTION"
>--with-libraries</TT
> in
         addition to this option.  <TT
CLASS="FILENAME"
>configure</TT
> will check
         for the required header files and libraries to make sure that
         your GSSAPI installation is sufficient before proceeding.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-krb5</TT
></DT
><DD
><P
>         Build with support for Kerberos 5 authentication. On many
         systems, the Kerberos system is not installed in a location
         that is searched by default (e.g., <TT
CLASS="FILENAME"
>/usr/include</TT
>,
         <TT
CLASS="FILENAME"
>/usr/lib</TT
>), so you must use the options
         <TT
CLASS="OPTION"
>--with-includes</TT
> and <TT
CLASS="OPTION"
>--with-libraries</TT
> in
         addition to this option.  <TT
CLASS="FILENAME"
>configure</TT
> will check
         for the required header files and libraries to make sure that
         your Kerberos installation is sufficient before proceeding.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-krb-srvnam=<TT
CLASS="REPLACEABLE"
><I
>NAME</I
></TT
></TT
></DT
><DD
><P
>         The default name of the Kerberos service principal (also used
         by GSSAPI).
         <TT
CLASS="LITERAL"
>postgres</TT
> is the default. There's usually no
         reason to change this unless you have a Windows environment,
         in which case it must be set to upper case
         <TT
CLASS="LITERAL"
>POSTGRES</TT
>.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-openssl</TT
></DT
><DD
><P
>         Build with support for <ACRONYM
CLASS="ACRONYM"
>SSL</ACRONYM
> (encrypted)
         connections. This requires the <SPAN
CLASS="PRODUCTNAME"
>OpenSSL</SPAN
>
         package to be installed.  <TT
CLASS="FILENAME"
>configure</TT
> will check
         for the required header files and libraries to make sure that
         your <SPAN
CLASS="PRODUCTNAME"
>OpenSSL</SPAN
> installation is sufficient
         before proceeding.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-pam</TT
></DT
><DD
><P
>         Build with <ACRONYM
CLASS="ACRONYM"
>PAM</ACRONYM
>
         (Pluggable Authentication Modules) support.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-ldap</TT
></DT
><DD
><P
>         Build with <ACRONYM
CLASS="ACRONYM"
>LDAP</ACRONYM
>
         support for authentication and connection parameter lookup (see
         <A
HREF="libpq-ldap.html"
>Section 31.16</A
> and
         <A
HREF="auth-methods.html#AUTH-LDAP"
>Section 19.3.8</A
> for more information). On Unix,
         this requires the <SPAN
CLASS="PRODUCTNAME"
>OpenLDAP</SPAN
> package to be
         installed. On Windows, the default <SPAN
CLASS="PRODUCTNAME"
>WinLDAP</SPAN
>
         library is used.  <TT
CLASS="FILENAME"
>configure</TT
> will check for the required
         header files and libraries to make sure that your
         <SPAN
CLASS="PRODUCTNAME"
>OpenLDAP</SPAN
> installation is sufficient before
         proceeding.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--without-readline</TT
></DT
><DD
><P
>         Prevents use of the <SPAN
CLASS="APPLICATION"
>Readline</SPAN
> library
         (and <SPAN
CLASS="APPLICATION"
>libedit</SPAN
> as well).  This option disables
         command-line editing and history in
         <SPAN
CLASS="APPLICATION"
>psql</SPAN
>, so it is not recommended.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-libedit-preferred</TT
></DT
><DD
><P
>         Favors the use of the BSD-licensed <SPAN
CLASS="APPLICATION"
>libedit</SPAN
> library
         rather than GPL-licensed <SPAN
CLASS="APPLICATION"
>Readline</SPAN
>.  This option
         is significant only if you have both libraries installed; the
         default in that case is to use <SPAN
CLASS="APPLICATION"
>Readline</SPAN
>.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-bonjour</TT
></DT
><DD
><P
>         Build with Bonjour support.  This requires Bonjour support
         in your operating system.  Recommended on Mac OS X.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-ossp-uuid</TT
></DT
><DD
><P
>         Build components using the <A
HREF="http://www.ossp.org/pkg/lib/uuid/"
TARGET="_top"
>OSSP UUID
         library</A
>.  Specifically, build the
         
         <A
HREF="uuid-ossp.html"
>uuid-ossp</A
> module,
         which provides functions to generate
         UUIDs.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-libxml</TT
></DT
><DD
><P
>         Build with libxml (enables SQL/XML support).  Libxml version 2.6.23 or
         later is required for this feature.
        </P
><P
>         Libxml installs a program <TT
CLASS="COMMAND"
>xml2-config</TT
> that
         can be used to detect the required compiler and linker
         options.  PostgreSQL will use it automatically if found.  To
         specify a libxml installation at an unusual location, you can
         either set the environment variable
         <TT
CLASS="ENVAR"
>XML2_CONFIG</TT
> to point to the
         <TT
CLASS="COMMAND"
>xml2-config</TT
> program belonging to the
         installation, or use the options
         <TT
CLASS="OPTION"
>--with-includes</TT
> and
         <TT
CLASS="OPTION"
>--with-libraries</TT
>.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-libxslt</TT
></DT
><DD
><P
>         Use libxslt when building the
         
         <A
HREF="xml2.html"
>xml2</A
>
         module.  <SPAN
CLASS="APPLICATION"
>xml2</SPAN
> relies on this library
         to perform XSL transformations of XML.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--disable-integer-datetimes</TT
></DT
><DD
><P
>         Disable support for 64-bit integer storage for timestamps and
         intervals, and store datetime values as floating-point
         numbers instead. Floating-point datetime storage was the
         default in <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> releases
         prior to 8.4, but it is now deprecated, because it does not
         support microsecond precision for the full range of
         <TT
CLASS="TYPE"
>timestamp</TT
> values. However, integer-based
         datetime storage requires a 64-bit integer type. Therefore,
         this option can be used when no such type is available, or
         for compatibility with applications written for prior
         versions of <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
>. See
         
         <A
HREF="datatype-datetime.html"
>Section 8.5</A
>
         for more information.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--disable-float4-byval</TT
></DT
><DD
><P
>         Disable passing float4 values <SPAN
CLASS="QUOTE"
>"by value"</SPAN
>, causing them
         to be passed <SPAN
CLASS="QUOTE"
>"by reference"</SPAN
> instead.  This option costs
         performance, but may be needed for compatibility with old
         user-defined functions that are written in C and use the
         <SPAN
CLASS="QUOTE"
>"version 0"</SPAN
> calling convention.  A better long-term
         solution is to update any such functions to use the
         <SPAN
CLASS="QUOTE"
>"version 1"</SPAN
> calling convention.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--disable-float8-byval</TT
></DT
><DD
><P
>         Disable passing float8 values <SPAN
CLASS="QUOTE"
>"by value"</SPAN
>, causing them
         to be passed <SPAN
CLASS="QUOTE"
>"by reference"</SPAN
> instead.  This option costs
         performance, but may be needed for compatibility with old
         user-defined functions that are written in C and use the
         <SPAN
CLASS="QUOTE"
>"version 0"</SPAN
> calling convention.  A better long-term
         solution is to update any such functions to use the
         <SPAN
CLASS="QUOTE"
>"version 1"</SPAN
> calling convention.
         Note that this option affects not only float8, but also int8 and some
         related types such as timestamp.
         On 32-bit platforms, <TT
CLASS="OPTION"
>--disable-float8-byval</TT
> is the default
         and it is not allowed to select <TT
CLASS="OPTION"
>--enable-float8-byval</TT
>.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-segsize=<TT
CLASS="REPLACEABLE"
><I
>SEGSIZE</I
></TT
></TT
></DT
><DD
><P
>         Set the <I
CLASS="FIRSTTERM"
>segment size</I
>, in gigabytes.  Large tables are
         divided into multiple operating-system files, each of size equal
         to the segment size.  This avoids problems with file size limits
         that exist on many platforms.  The default segment size, 1 gigabyte,
         is safe on all supported platforms.  If your operating system has
         <SPAN
CLASS="QUOTE"
>"largefile"</SPAN
> support (which most do, nowadays), you can use
         a larger segment size.  This can be helpful to reduce the number of
         file descriptors consumed when working with very large tables.
         But be careful not to select a value larger than is supported
         by your platform and the file systems you intend to use.  Other
         tools you might wish to use, such as <SPAN
CLASS="APPLICATION"
>tar</SPAN
>, could
         also set limits on the usable file size.
         It is recommended, though not absolutely required, that this value
         be a power of 2.
         Note that changing this value requires an initdb.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-blocksize=<TT
CLASS="REPLACEABLE"
><I
>BLOCKSIZE</I
></TT
></TT
></DT
><DD
><P
>         Set the <I
CLASS="FIRSTTERM"
>block size</I
>, in kilobytes.  This is the unit
         of storage and I/O within tables.  The default, 8 kilobytes,
         is suitable for most situations; but other values may be useful
         in special cases.
         The value must be a power of 2 between 1 and 32 (kilobytes).
         Note that changing this value requires an initdb.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-wal-segsize=<TT
CLASS="REPLACEABLE"
><I
>SEGSIZE</I
></TT
></TT
></DT
><DD
><P
>         Set the <I
CLASS="FIRSTTERM"
>WAL segment size</I
>, in megabytes.  This is
         the size of each individual file in the WAL log.  It may be useful
         to adjust this size to control the granularity of WAL log shipping.
         The default size is 16 megabytes.
         The value must be a power of 2 between 1 and 64 (megabytes).
         Note that changing this value requires an initdb.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-wal-blocksize=<TT
CLASS="REPLACEABLE"
><I
>BLOCKSIZE</I
></TT
></TT
></DT
><DD
><P
>         Set the <I
CLASS="FIRSTTERM"
>WAL block size</I
>, in kilobytes.  This is the unit
         of storage and I/O within the WAL log.  The default, 8 kilobytes,
         is suitable for most situations; but other values may be useful
         in special cases.
         The value must be a power of 2 between 1 and 64 (kilobytes).
         Note that changing this value requires an initdb.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--disable-spinlocks</TT
></DT
><DD
><P
>         Allow the build to succeed even if <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
>
         has no CPU spinlock support for the platform.  The lack of
         spinlock support will result in poor performance; therefore,
         this option should only be used if the build aborts and
         informs you that the platform lacks spinlock support. If this
         option is required to build <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> on
         your platform, please report the problem to the
         <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> developers.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--disable-thread-safety</TT
></DT
><DD
><P
>         Disable the thread-safety of client libraries.  This prevents
         concurrent threads in <SPAN
CLASS="APPLICATION"
>libpq</SPAN
> and
         <SPAN
CLASS="APPLICATION"
>ECPG</SPAN
> programs from safely controlling
         their private connection handles.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--with-system-tzdata=<TT
CLASS="REPLACEABLE"
><I
>DIRECTORY</I
></TT
></TT
></DT
><DD
><P
>         <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> includes its own time zone database,
         which it requires for date and time operations.  This time zone
         database is in fact compatible with the <SPAN
CLASS="QUOTE"
>"zoneinfo"</SPAN
> time zone
         database provided by many operating systems such as FreeBSD,
         Linux, and Solaris, so it would be redundant to install it again.
         When this option is used, the system-supplied time zone database
         in <TT
CLASS="REPLACEABLE"
><I
>DIRECTORY</I
></TT
> is used instead of the one
         included in the PostgreSQL source distribution.
         <TT
CLASS="REPLACEABLE"
><I
>DIRECTORY</I
></TT
> must be specified as an
         absolute path.  <TT
CLASS="FILENAME"
>/usr/share/zoneinfo</TT
> is a
         likely directory on some operating systems.  Note that the
         installation routine will not detect mismatching or erroneous time
         zone data.  If you use this option, you are advised to run the
         regression tests to verify that the time zone data you have
         pointed to works correctly with <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
>.
        </P
><P
>         This option is mainly aimed at binary package distributors
         who know their target operating system well.  The main
         advantage of using this option is that the PostgreSQL package
         won't need to be upgraded whenever any of the many local
         daylight-saving time rules change.  Another advantage is that
         PostgreSQL can be cross-compiled more straightforwardly if the
         time zone database files do not need to be built during the
         installation.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--without-zlib</TT
></DT
><DD
><P
>         
         Prevents use of the <SPAN
CLASS="APPLICATION"
>Zlib</SPAN
> library.  This disables
         support for compressed archives in <SPAN
CLASS="APPLICATION"
>pg_dump</SPAN
>
         and <SPAN
CLASS="APPLICATION"
>pg_restore</SPAN
>.
         This option is only intended for those rare systems where this
         library is not available.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--enable-debug</TT
></DT
><DD
><P
>         Compiles all programs and libraries with debugging symbols.
         This means that you can run the programs in a debugger
         to analyze problems. This enlarges the size of the installed
         executables considerably, and on non-GCC compilers it usually
         also disables compiler optimization, causing slowdowns. However,
         having the symbols available is extremely helpful for dealing
         with any problems that might arise.  Currently, this option is
         recommended for production installations only if you use GCC.
         But you should always have it on if you are doing development work
         or running a beta version.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--enable-coverage</TT
></DT
><DD
><P
>         If using GCC, all programs and libraries are compiled with
         code coverage testing instrumentation.  When run, they
         generate files in the build directory with code coverage
         metrics.
         See <A
HREF="regress-coverage.html"
>Section 30.4</A
>
         for more information. This option is for use only with GCC
         and when doing development work.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--enable-profiling</TT
></DT
><DD
><P
>         If using GCC, all programs and libraries are compiled so they
         can be profiled.  On backend exit, a subdirectory will be created
         that contains the <TT
CLASS="FILENAME"
>gmon.out</TT
> file for use in profiling.
         This option is for use only with GCC and when doing development work.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--enable-cassert</TT
></DT
><DD
><P
>         Enables <I
CLASS="FIRSTTERM"
>assertion</I
> checks in the server, which test for
         many <SPAN
CLASS="QUOTE"
>"cannot happen"</SPAN
> conditions.  This is invaluable for
         code development purposes, but the tests can slow down the
         server significantly.
         Also, having the tests turned on won't necessarily enhance the
         stability of your server!  The assertion checks are not categorized
         for severity, and so what might be a relatively harmless bug will
         still lead to server restarts if it triggers an assertion
         failure.  This option is not recommended for production use, but
         you should have it on for development work or when running a beta
         version.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--enable-depend</TT
></DT
><DD
><P
>         Enables automatic dependency tracking.  With this option, the
         makefiles are set up so that all affected object files will
         be rebuilt when any header file is changed.  This is useful
         if you are doing development work, but is just wasted overhead
         if you intend only to compile once and install.  At present,
         this option only works with GCC.
        </P
></DD
><DT
><TT
CLASS="OPTION"
>--enable-dtrace</TT
></DT
><DD
><P
>         
         Compiles <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> with support for the
         dynamic tracing tool DTrace.
         See <A
HREF="dynamic-trace.html"
>Section 27.4</A
>
         for more information.
        </P
><P
>         To point to the <TT
CLASS="COMMAND"
>dtrace</TT
> program, the
         environment variable <TT
CLASS="ENVAR"
>DTRACE</TT
> can be set.  This
         will often be necessary because <TT
CLASS="COMMAND"
>dtrace</TT
> is
         typically installed under <TT
CLASS="FILENAME"
>/usr/sbin</TT
>,
         which might not be in the path.
        </P
><P
>         Extra command-line options for the <TT
CLASS="COMMAND"
>dtrace</TT
> program
         can be specified in the environment variable
         <TT
CLASS="ENVAR"
>DTRACEFLAGS</TT
>.  On Solaris,
         to include DTrace support in a 64-bit binary, you must specify
         <TT
CLASS="LITERAL"
>DTRACEFLAGS="-64"</TT
> to configure.  For example,
         using the GCC compiler:
</P><PRE
CLASS="SCREEN"
>./configure CC='gcc -m64' --enable-dtrace DTRACEFLAGS='-64' ...</PRE
><P>
         Using Sun's compiler:
</P><PRE
CLASS="SCREEN"
>./configure CC='/opt/SUNWspro/bin/cc -xtarget=native64' --enable-dtrace DTRACEFLAGS='-64' ...</PRE
><P>
        </P
></DD
></DL
></DIV
><P>
    </P
><P
>     If you prefer a C compiler different from the one
     <TT
CLASS="FILENAME"
>configure</TT
> picks, you can set the
     environment variable <TT
CLASS="ENVAR"
>CC</TT
> to the program of your choice.
     By default, <TT
CLASS="FILENAME"
>configure</TT
> will pick
     <TT
CLASS="FILENAME"
>gcc</TT
> if available, else the platform's
     default (usually <TT
CLASS="FILENAME"
>cc</TT
>).  Similarly, you can override the
     default compiler flags if needed with the <TT
CLASS="ENVAR"
>CFLAGS</TT
> variable.
    </P
><P
>     You can specify environment variables on the
     <TT
CLASS="FILENAME"
>configure</TT
> command line, for example:
</P><PRE
CLASS="SCREEN"
><KBD
CLASS="USERINPUT"
>./configure CC=/opt/bin/gcc CFLAGS='-O2 -pipe'</KBD
></PRE
><P>
    </P
><P
>     Here is a list of the significant variables that can be set in
     this manner:

     <P
></P
></P><DIV
CLASS="VARIABLELIST"
><DL
><DT
><TT
CLASS="ENVAR"
>BISON</TT
></DT
><DD
><P
>         Bison program
        </P
></DD
><DT
><TT
CLASS="ENVAR"
>CC</TT
></DT
><DD
><P
>         C compiler
        </P
></DD
><DT
><TT
CLASS="ENVAR"
>CFLAGS</TT
></DT
><DD
><P
>         options to pass to the C compiler
        </P
></DD
><DT
><TT
CLASS="ENVAR"
>CPP</TT
></DT
><DD
><P
>         C preprocessor
        </P
></DD
><DT
><TT
CLASS="ENVAR"
>CPPFLAGS</TT
></DT
><DD
><P
>         options to pass to the C preprocessor
        </P
></DD
><DT
><TT
CLASS="ENVAR"
>DTRACE</TT
></DT
><DD
><P
>         location of the <TT
CLASS="COMMAND"
>dtrace</TT
> program
        </P
></DD
><DT
><TT
CLASS="ENVAR"
>DTRACEFLAGS</TT
></DT
><DD
><P
>         options to pass to the <TT
CLASS="COMMAND"
>dtrace</TT
> program
        </P
></DD
><DT
><TT
CLASS="ENVAR"
>FLEX</TT
></DT
><DD
><P
>         Flex program
        </P
></DD
><DT
><TT
CLASS="ENVAR"
>LDFLAGS</TT
></DT
><DD
><P
>         options to use when linking either executables or shared libraries
        </P
></DD
><DT
><TT
CLASS="ENVAR"
>LDFLAGS_EX</TT
></DT
><DD
><P
>         additional options for linking executables only
        </P
></DD
><DT
><TT
CLASS="ENVAR"
>LDFLAGS_SL</TT
></DT
><DD
><P
>         additional options for linking shared libraries only
        </P
></DD
><DT
><TT
CLASS="ENVAR"
>MSGFMT</TT
></DT
><DD
><P
>         <TT
CLASS="COMMAND"
>msgfmt</TT
> program for native language support
        </P
></DD
><DT
><TT
CLASS="ENVAR"
>PERL</TT
></DT
><DD
><P
>         Full path to the Perl interpreter.  This will be used to
         determine the dependencies for building PL/Perl.
        </P
></DD
><DT
><TT
CLASS="ENVAR"
>PYTHON</TT
></DT
><DD
><P
>         Full path to the Python interpreter.  This will be used to
         determine the dependencies for building PL/Python.  Also,
         whether Python 2 or 3 is specified here (or otherwise
         implicitly chosen) determines which variant of the PL/Python
         language becomes available.  See
         
         <A
HREF="plpython-python23.html"
>Section 42.1</A
>
         for more information.
        </P
></DD
><DT
><TT
CLASS="ENVAR"
>TCLSH</TT
></DT
><DD
><P
>         Full path to the Tcl interpreter.  This will be used to
         determine the dependencies for building PL/Tcl, and it will
         be substituted into Tcl scripts.
        </P
></DD
><DT
><TT
CLASS="ENVAR"
>XML2_CONFIG</TT
></DT
><DD
><P
>         <TT
CLASS="COMMAND"
>xml2-config</TT
> program used to locate the
         libxml installation.
        </P
></DD
></DL
></DIV
><P>
    </P
></LI
><LI
CLASS="STEP"
><A
NAME="BUILD"
></A
><P
><B
>Build</B
></P
><P
>    To start the build, type:
</P><PRE
CLASS="SCREEN"
><KBD
CLASS="USERINPUT"
>gmake</KBD
></PRE
><P>
    (Remember to use <ACRONYM
CLASS="ACRONYM"
>GNU</ACRONYM
> <SPAN
CLASS="APPLICATION"
>make</SPAN
>.) The build
    will take a few minutes depending on your
    hardware. The last line displayed should be:
</P><PRE
CLASS="SCREEN"
>All of PostgreSQL is successfully made. Ready to install.</PRE
><P>
   </P
><P
>   If you want to build everything that can be built, including the
   documentation (HTML and man pages), and the additional modules
   (<TT
CLASS="FILENAME"
>contrib</TT
>), type instead:
</P><PRE
CLASS="SCREEN"
><KBD
CLASS="USERINPUT"
>gmake world</KBD
></PRE
><P>
   The last line displayed should be:
</P><PRE
CLASS="SCREEN"
>PostgreSQL, contrib and HTML documentation successfully made. Ready to install.</PRE
><P>
   </P
></LI
><LI
CLASS="STEP"
><P
><B
>Regression Tests</B
></P
><P
>    If you want to test the newly built server before you install it,
    you can run the regression tests at this point. The regression
    tests are a test suite to verify that <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
>
    runs on your machine in the way the developers expected it
    to. Type:
</P><PRE
CLASS="SCREEN"
><KBD
CLASS="USERINPUT"
>gmake check</KBD
></PRE
><P>
    (This won't work as root; do it as an unprivileged user.)
    
    <A
HREF="regress.html"
>Chapter 30</A
> contains
    detailed information about interpreting the test results. You can
    repeat this test at any later time by issuing the same command.
   </P
></LI
><LI
CLASS="STEP"
><A
NAME="INSTALL"
></A
><P
><B
>Installing the Files</B
></P
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>     If you are upgrading an existing system be sure to read
     
     <A
HREF="upgrading.html"
>Section 17.6</A
>
     which has instructions about upgrading a
     cluster.
    </P
></BLOCKQUOTE
></DIV
><P
>    To install <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> enter:
</P><PRE
CLASS="SCREEN"
><KBD
CLASS="USERINPUT"
>gmake install</KBD
></PRE
><P>
    This will install files into the directories that were specified
    in <A
HREF="install-procedure.html#CONFIGURE"
>step 1</A
>. Make sure that you have appropriate
    permissions to write into that area. Normally you need to do this
    step as root. Alternatively, you can create the target
    directories in advance and arrange for appropriate permissions to
    be granted.
   </P
><P
>    To install the documentation (HTML and man pages), enter:
</P><PRE
CLASS="SCREEN"
><KBD
CLASS="USERINPUT"
>gmake install-docs</KBD
></PRE
><P>
   </P
><P
>    If you built the world above, type instead:
</P><PRE
CLASS="SCREEN"
><KBD
CLASS="USERINPUT"
>gmake install-world</KBD
></PRE
><P>
    This also installs the documentation.
   </P
><P
>    You can use <TT
CLASS="LITERAL"
>gmake install-strip</TT
> instead of
    <TT
CLASS="LITERAL"
>gmake install</TT
> to strip the executable files and
    libraries as they are installed.  This will save some space.  If
    you built with debugging support, stripping will effectively
    remove the debugging support, so it should only be done if
    debugging is no longer needed.  <TT
CLASS="LITERAL"
>install-strip</TT
>
    tries to do a reasonable job saving space, but it does not have
    perfect knowledge of how to strip every unneeded byte from an
    executable file, so if you want to save all the disk space you
    possibly can, you will have to do manual work.
   </P
><P
>    The standard installation provides all the header files needed for client
    application development as well as for server-side program
    development, such as custom functions or data types written in C.
    (Prior to <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> 8.0, a separate <TT
CLASS="LITERAL"
>gmake
    install-all-headers</TT
> command was needed for the latter, but this
    step has been folded into the standard install.)
   </P
><DIV
CLASS="FORMALPARA"
><P
><B
>Client-only installation: </B
>     If you want to install only the client applications and
     interface libraries, then you can use these commands:
</P><PRE
CLASS="SCREEN"
><KBD
CLASS="USERINPUT"
>gmake -C src/bin install</KBD
>
<KBD
CLASS="USERINPUT"
>gmake -C src/include install</KBD
>
<KBD
CLASS="USERINPUT"
>gmake -C src/interfaces install</KBD
>
<KBD
CLASS="USERINPUT"
>gmake -C doc install</KBD
></PRE
><P>
    <TT
CLASS="FILENAME"
>src/bin</TT
> has a few binaries for server-only use,
    but they are small.
    </P
></DIV
></LI
></OL
></DIV
><DIV
CLASS="FORMALPARA"
><P
><B
>Registering <SPAN
CLASS="APPLICATION"
>eventlog</SPAN
> on <SPAN
CLASS="SYSTEMITEM"
>Windows</SPAN
>: </B
>    To register a <SPAN
CLASS="SYSTEMITEM"
>Windows</SPAN
> <SPAN
CLASS="APPLICATION"
>eventlog</SPAN
>
    library with the operating system, issue this command after installation:
</P><PRE
CLASS="SCREEN"
><KBD
CLASS="USERINPUT"
>regsvr32 <TT
CLASS="REPLACEABLE"
><I
>pgsql_library_directory</I
></TT
>/pgevent.dll</KBD
></PRE
><P>
    This creates registry entries used by the event viewer.
   </P
></DIV
><DIV
CLASS="FORMALPARA"
><P
><B
>Uninstallation: </B
>    To undo the installation use the command <TT
CLASS="COMMAND"
>gmake
    uninstall</TT
>. However, this will not remove any created directories.
   </P
></DIV
><DIV
CLASS="FORMALPARA"
><P
><B
>Cleaning: </B
>    After the installation you can free disk space by removing the built
    files from the source tree with the command <TT
CLASS="COMMAND"
>gmake
    clean</TT
>. This will preserve the files made by the <TT
CLASS="COMMAND"
>configure</TT
>
    program, so that you can rebuild everything with <TT
CLASS="COMMAND"
>gmake</TT
>
    later on. To reset the source tree to the state in which it was
    distributed, use <TT
CLASS="COMMAND"
>gmake distclean</TT
>. If you are going to
    build for several platforms within the same source tree you must do
    this and re-configure for each platform.  (Alternatively, use
    a separate build tree for each platform, so that the source tree
    remains unmodified.)
   </P
></DIV
><P
>   If you perform a build and then discover that your <TT
CLASS="COMMAND"
>configure</TT
>
   options were wrong, or if you change anything that <TT
CLASS="COMMAND"
>configure</TT
>
   investigates (for example, software upgrades), then it's a good
   idea to do <TT
CLASS="COMMAND"
>gmake distclean</TT
> before reconfiguring and
   rebuilding.  Without this, your changes in configuration choices
   might not propagate everywhere they need to.
  </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="install-getsource.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="install-post.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Getting The Source</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="installation.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Post-Installation Setup</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>